/**
* Author: fulishang
* Create Time  : 2016年4月24日,下午10:32:06
* Modify Time :
* Desc  : 
*/
package com.sam.hr.domain;

import java.io.Serializable;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

@Entity
@Table(name="checkback_if")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class CheckBack implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="check_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	//是否同意申请
	@Column(name="check_result", nullable=false)
	private boolean result;
	
	//批复理由
	@Column(name="check_reason", length=255)
	private String reason;
	
	//批复对应的申请
	@OneToOne(targetEntity=Application.class)
	@JoinColumn(name="app_id", nullable=false, unique=false)
	private Application app;
	
	//批复的经理
	@ManyToOne(targetEntity=Manager.class)
	@JoinColumn(name="mgr_id", nullable=false)
	private Manager manager;
	
	//无参构造
	public CheckBack(){
		
	}
	
	//初始化全部的成员变量构造器
	public CheckBack(Integer id, boolean result, String reason, Application app, Manager manager) {
		this.id = id;
		this.result = result;
		this.reason = reason;
		this.app = app;
		this.manager = manager;
	}

	//getter&setter
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public boolean isResult() {
		return result;
	}

	public void setResult(boolean result) {
		this.result = result;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public Application getApp() {
		return app;
	}

	public void setApp(Application app) {
		this.app = app;
	}

	public Manager getManager() {
		return manager;
	}

	public void setManager(Manager manager) {
		this.manager = manager;
	}
	
	
	
}
